<template>
	<view class="wrap">
		<view class="li">
			<view class="li-z">
				<text class="z-zi">月收费</text><text style="color: #FF7937;">*</text>
			</view>
			<input type="digit" v-model="mounthFee" class="inputstyle" placeholder="请输入" placeholder-class="placeholder" />
		</view>
		<view class="li">
			<view class="li-z">
				<text class="z-zi">午餐</text><text style="color: #FF7937;">*</text>
			</view>
			<input type="digit" v-model="lunchFee" placeholder="请输入" placeholder-class="placeholder"  class="inputstyle"/>
		</view>
		<view class="li">
			<view class="li-z">
				<text class="z-zi">晚餐</text><text style="color: #FF7937;">*</text>
			</view>
			<input type="digit" v-model="dinnerFee" placeholder="请输入" placeholder-class="placeholder"  class="inputstyle"/>
		</view>		
		<button type="default" class="submit" @click="submit">确定</button>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mounthFee:"", 
				lunchFee:"",
				dinnerFee:"",
            }	
		},
		onLoad() {

            
		},
		methods: {
			submit(){

				if(!this.mounthFee){
					this.$u.toast("月收费不能为空")
					return;
				}
				if(!this.lunchFee){
					this.$u.toast("午餐费用不能为空")
					return;
				}
				if(!this.dinnerFee){
					this.$u.toast("晚餐费用不能为空")
					return;
				}
				let form = {
					mounth_fee:this.mounthFee,
					lunch_fee:this.lunchFee,
					dinner_fee:this.dinnerFee,
				}
				this.$u.post('api/school/addfeemoban', form).then(res => {
							this.$refs.uToast.show({
									title: '成功',
									url: '/pages/finance/price'
							})
							return;
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #F7F7F7;
	}
	
	.wrap {
		
		.li{
			display: flex;
			padding: 0 26rpx 0 44rpx;
			background-color: #fff;
			align-items: center;
			height: 120rpx;
			justify-content: space-between;
			margin-bottom: 20rpx;
			.z-zi{
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #333333;
				padding-right: 10rpx;
			}
			.inputstyle{
				text-align: right;
				color: #333333;
			}
			.placeholder
			{
				font-size: 28rpx;
				color:"#999999";
			}
		}
		
	}
	
	.submit{
		width: 90%;
		line-height: 87rpx;
		background: #2165F7;
		border-radius: 44px;
		color: #fff;
		margin: 190rpx auto 0;
	}
	
</style>
